﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IOP.OpenType.Tables
{
    /// <summary>
    /// CFF表
    /// </summary>
    public class CFFTable : Table
    {
        /// <summary>
        /// 表头
        /// </summary>
        public CFFTableHeader Header { get; set; }
        /// <summary>
        /// 名称索引
        /// </summary>
        public string[] NameIndexes { get; set; } = Array.Empty<string>();
        /// <summary>
        /// 顶层索引
        /// </summary>
        public DICTData TopLevelIndex { get; set; } = null;
        /// <summary>
        /// 字符集
        /// </summary>
        public CFFFontSet FontSet { get; set; }
    }

    /// <summary>
    /// CFF字符集
    /// </summary>
    public class CFFFontSet
    {

    }

    /// <summary>
    /// CFF表头
    /// </summary>
    public struct CFFTableHeader
    {
        /// <summary>
        /// 主版本
        /// </summary>
        public Card8 Major;
        /// <summary>
        /// 副版本
        /// </summary>
        public Card8 Minor;
        /// <summary>
        /// 头大小
        /// </summary>
        public Card8 HdrSize;
        /// <summary>
        /// 偏移（始终为0）
        /// </summary>
        public OffSize OffSize;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="major"></param>
        /// <param name="min"></param>
        /// <param name="hdr"></param>
        /// <param name="offS"></param>
        public CFFTableHeader(byte major, byte min, byte hdr, byte offS)
        {
            Major = major;
            Minor = min;
            HdrSize = hdr;
            OffSize = offS;
        }
    }
}
